. $topsrcdir/browser/config/mozconfig

#default: build Firefox
ac_add_options --enable-application=browser

#default:
ac_add_options --enable-optimize

# https://developer.mozilla.org/en-US/docs/Configuring_Build_Options
ac_add_options --disable-debug


#speed up? when compiling
ac_add_options --disable-tests

#default:
ac_add_options --enable-crypto

ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib

ac_add_options --enable-official-branding

# System libraries
ac_add_options --with-system-nspr

#ac_add_options --with-system-nss
ac_add_options --without-system-nss

ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi

# Features
ac_add_options --enable-startup-notification

ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-installer
ac_add_options --disable-debug-symbols

#extra security
#can't enable this because compiler errors:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/js/src/gdb/Unified_cpp_js_src_gdb0.i_o:Unified_cpp_js_src_gdb0.cpp:function Fragment_Root_barriers::run(JSContext*, char const**&): error: undefined reference to '__asan_poison_memory_region'
#ac_add_options --enable-address-sanitizer

#can't enable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/js/src/vm/Compression.cpp:112:32: error: ‘__msan_unpoison’ was not declared in this scope
#ac_add_options --enable-memory-sanitizer

ac_add_options --disable-profiling
ac_add_options --disable-systrace
ac_add_options --disable-valgrind
ac_add_options --disable-jprof
ac_add_options --disable-shark
ac_add_options --disable-instruments
ac_add_options --disable-callgrind
ac_add_options --disable-vtune
ac_add_options --disable-cpp-rtti
ac_add_options --enable-gold
#--with-pthreads
ac_add_options --disable-dtrace
ac_add_options --with-x
ac_add_options --disable-printing
ac_add_options --disable-gnomevfs
ac_add_options --disable-gio
#ac_add_options --disable-gconf
ac_add_options --disable-libproxy
ac_add_options --disable-gnomeui
ac_add_options --disable-dbus #!!!!
ac_add_options --disable-websms-backend
ac_add_options --disable-dbm #!!!!
ac_add_options --disable-accessibility
ac_add_options --disable-webrtc


#can't disable this because compilation error
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::SpeechSynthesis'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/Window.webidl line 231:68
#ac_add_options --disable-webspeech

#ac_add_options --enable-raw
ac_add_options --disable-raw

#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/content/media/ogg/OggWriter.h:10:30: fatal error: OpusTrackEncoder.h: No such file or directory
#ac_add_options --disable-opus


#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/content/media/mediasource/ContainerParser.cpp:9:32: fatal error: WebMBufferedParser.h: No such file or directory
#ac_add_options --disable-webm


ac_add_options --disable-directshow
ac_add_options --disable-wmf
ac_add_options --disable-ffmpeg
ac_add_options --disable-fmp4

#can't disable this or else compilation error:
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::MediaKeys'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/HTMLMediaElement.webidl line 150:21
#ac_add_options --disable-eme

#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/NavigatorBinding.cpp:1204:9: error: ‘class mozilla::dom::Navigator’ has no member named ‘MozGetUserMediaDevices’
#ac_add_options --disable-media-navigator


ac_add_options --disable-omx-plugin
ac_add_options --disable-wave

#ac_add_options --enable-alsa
ac_add_options --disable-alsa


#ac_add_options --enable-pulseaudio
ac_add_options --disable-pulseaudio

#ac_add_options --enable-gstreamer
ac_add_options --disable-gstreamer

#see ./configure --help | less
ac_add_options --disable-system-extension-dirs
# https://mxr.mozilla.org/mozilla-central/source/extensions/
ac_add_options --enable-extensions=default,-skipgnomevfs,-skipgio
#ac_add_options --disable-pref-extensions
#ac_add_options --disable-negotiateauth
#ac_add_options --disable-permissions
#ac_add_options --disable-universalchardet


#can't disable this because compilation error:
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::Gamepad'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/Navigator.webidl line 272:11
#ac_add_options --disable-gamepad


ac_add_options --disable-crashreporter
#ac_add_options --disable-libjpeg-turbo
#ac_add_options --enable-tree-freetype
ac_add_options --disable-webapp-runtime
ac_add_options --disable-maintenance-service
ac_add_options --disable-bundled-fonts
ac_add_options --disable-verify-mar
ac_add_options --disable-signmar
ac_add_options --disable-parental-controls
ac_add_options --enable-sandbox
ac_add_options --enable-content-sandbox

#Cannot build Firefox with --disable-feeds
#ac_add_options --disable-feeds

ac_add_options --disable-safe-browsing
#ac_add_options --enable-url-classifier


#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/startupcache/StartupCache.cpp:29:26: fatal error: nsIZipWriter.h: No such file or directory
#ac_add_options --disable-zipwriter


#ac_add_options --enable-faststripe
#ac_add_options --enable-mobile-optimize
ac_add_options --disable-logging
ac_add_options --disable-logrefcnt
ac_add_options --disable-dump-painting
ac_add_options --disable-trace-malloc

#ac_add_options --enable-dmd
#ac_add_options --enable-jemalloc

#ac_add_options --enable-trace-jscalls
#ac_add_options --disable-gcincremental
#ac_add_options --disable-gcgenerational
#ac_add_options --enable-gccompacting
#ac_add_options --enable-small-chunk-size
#ac_add_options --enable-gczeal
ac_add_options --enable-strip
#ac_add_options --enable-install-strip

#not needed, unless it fails at some point
#ac_add_options --disable-elf-hack

ac_add_options --disable-tasktracer
ac_add_options --disable-visual-event-tracer
ac_add_options --disable-stdcxx-compat

ac_add_options --disable-startupcache

ac_add_options --disable-b2g-ril
ac_add_options --disable-b2g-bt
ac_add_options --disable-nfc
ac_add_options --disable-synth-pico
ac_add_options --disable-b2g-camera

#says invalid option, odd:
#ac_add_options --jitreport-granularity=0

#ac_add_options --enable-xterm-updates

#can't disable this because compilation error
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/gfx/2d/convolver.h:38:26: fatal error: skia/SkTypes.h: No such file or directory
#ac_add_options --disable-skia

#ac_add_options --enable-system-cairo
ac_add_options --enable-system-pixman

#trying to avoid a compilation error XPIDL_MODULE cannot be defined unless there are XPIDL_SOURCES
#ac_add_options --disable-xul

ac_add_options --enable-profilelocking
ac_add_options --disable-necko-wifi
#ac_add_options --disable-cookies

ac_add_options --disable-ctypes

ac_add_options --with-system-icu
ac_add_options --without-intl-api


#must update ccache or else -fprofile-generate  is not recognized and thus not ccached!

#FIXME: currently getting this error and don't know what causes it, doesn't seem to be these options, must be something else that changed because it worked ok before.
#configure: error: Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain

# PGO
#commented out to prevent lockup when compiling:
#mk_add_options MOZ_PGO=1
#mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# autoconf
mk_add_options AUTOCONF=autoconf-2.13

# tell firefox to use python2 because python points to python3 in arch
mk_add_options PYTHON=/usr/bin/python2

#this is actually auto selected to be right, but I wanna be sure, because I've seen only 3 cc1plus most of the time with 'top'
mk_add_options MOZ_MAKE_FLAGS="-j4"


ac_add_options --with-ccache=/usr/bin/ccache



# vim:set ft=sh:
